﻿<%@ WebHandler Language="C#" Class="deleteCustomer" %>

using System;
using System.Web;

using AMCBO;
using AMCOBJ;

public class deleteCustomer : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        //context.Response.ContentType = "text/plain";
        //context.Response.Write("Hello World");
        customer cusBO = new customer();
        customer_obj cusObj = new customer_obj();
        int x;
        if (!string.IsNullOrEmpty(context.Request.QueryString["cid"]))
        {
            cusObj.Cus_Guid = new Guid(context.Request.QueryString["cid"].ToString());
        }
        Guid userID = Guid.Empty;
        HttpCookie oCookieID = (HttpCookie)context.Request.Cookies["userid"];
        if (oCookieID.Value != string.Empty)
        {
            userID = new Guid(oCookieID.Value);
        }
        cusObj.Upd_UserID = userID;
        cusObj.Upd_DT = System.DateTime.Now.ToString();
        int status = 0;
        x = cusBO.deleteCustomer(cusObj, status);
        try
        {
            if (x == 0)
            {
                context.Response.Write("y");
            }
            else
            {
                context.Response.Write("n");
            }
        }
        catch
        {
            context.Response.Write("failed");
        }
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}